<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "project".
 *
 * @property integer $id
 * @property string $name
 * @property string $rate
 * @property string $description
 * @property string $guide
 * @property string $link
 *
 * @property AccProject[] $accProjects
 */
class Project extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'project';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'rate', 'description', 'guide', 'link'], 'required'],
            [['description', 'guide', 'link'], 'string'],
            [['name', 'rate'], 'string', 'max' => 100]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Tên dự án',
            'rate' => 'Giá captcha',
            'description' => 'Mô tả',
            'guide' => 'Hướng dẫn',
            'link' => 'Địa chỉ',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getAccProjects()
    {
        return $this->hasMany(AccProject::className(), ['pro_id' => 'id']);
    }
}
